package cn.swu.lzr.page;

import cn.swu.lzr.JDBC.DBTools;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import java.io.IOException;

public class subPageServlet extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        int CountEveryPage = 5;
        DBTools dbTools = new DBTools();
        HttpSession session = request.getSession();
        Integer Currentpage =  (Integer) session.getAttribute("CurrentPage");
        try {

            if (Currentpage > 1){
                Currentpage--;
                session.setAttribute("CurrentPage",Currentpage);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        response.sendRedirect("main.html");

    }



}
